package 抽象;
/*
* 抽象类的匿名类
* */
public class PersonTest {
    public static void main(String[] args) {
        method(new Student());//匿名对象
        Worker worker=new Worker();
        method1(worker);
    }
    public static void method(Student s){
    }
    public static void method1(Person p){
        p.eat();
        p.walk();
    }
}
class Worker extends Person{

    @Override
    public void breath() {

    }

    @Override
    public void eat() {

    }
}